package com.xinzhi.shop;
import com.xinzhi.shop.constant.ShopConstant;
import com.xinzhi.shop.util.ScannerUtil;
/**
 * @author zn
 * @date 2020/2/20
 **/
public class GoodsManger {
    public static void main(String[] args) {
        System.out.println("请根据提示选择相应的功能：");
        boolean flag = true;
        while (flag) {
            System.out.println(
                    ShopConstant.GOODS_PUT + "：商品上架 " +
                            ShopConstant.GOODS_OUT + "：商品下架 " +
                            ShopConstant.GOODS_UPDATE + "：商品修改 " +
                            ShopConstant.GOODS_MESSAGE + "：商品信息 " +
                            ShopConstant.FUNCTION_EXIT + "：退出 "
            );
            String function = ScannerUtil.getInput();
            if (ShopConstant.GOODS_PUT.equals(function)) {
                Goods.goodsPut();
            } else if (ShopConstant.GOODS_OUT.equals(function)) {
                Goods.goodsOut();
            } else if (ShopConstant.GOODS_UPDATE.equals(function)) {
                Goods.goodsUpdatePrice();
            } else if (ShopConstant.GOODS_MESSAGE.equals(function)) {
                Goods.showGoods();
            } else if (ShopConstant.FUNCTION_EXIT.equals(function)) {
                System.exit(-1);
            }
        }
    }
}